<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:69:"D:\www\fdc\public/../application/manage\view\setting\weixin_edit.html";i:1491819872;s:63:"D:\www\fdc\public/../application/manage\view\public\header.html";i:1490355172;s:63:"D:\www\fdc\public/../application/manage\view\public\footer.html";i:1474280020;}*/ ?>
<!doctype html>
<html>
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<link href="__CSS__/style.css" rel="stylesheet"/>
	<title>管理中心</title>

</head>

<body>
<div id="J_ajax_loading" class="ajax_loading">加载中...</div>

<div class="subnav">
    <div class="content_menu ib_a blue line_x">
        <?php if(!empty($sub_menu) OR !empty($big_menu)): if(!(empty($big_menu) || (($big_menu instanceof \think\Collection || $big_menu instanceof \think\Paginator ) && $big_menu->isEmpty()))): if(isset($normal)): ?>
        <a class="add fb" href="<?php echo $big_menu['iframe']; ?>"><em><?php echo $big_menu['title']; ?></em></a>
        <?php else: ?>
    	<a class="add fb J_showdialog" href="javascript:void(0);" data-uri="<?php echo $big_menu['iframe']; ?>" data-title="<?php echo $big_menu['title']; ?>" data-id="<?php echo $big_menu['id']; ?>" data-width="<?php echo $big_menu['width']; ?>" data-height="<?php echo $big_menu['height']; ?>"><em><?php echo $big_menu['title']; ?></em></a>
        <?php endif; endif; if(!(empty($sub_menu) || (($sub_menu instanceof \think\Collection || $sub_menu instanceof \think\Paginator ) && $sub_menu->isEmpty()))): if(is_array($sub_menu) || $sub_menu instanceof \think\Collection || $sub_menu instanceof \think\Paginator): $key = 0; $__LIST__ = $sub_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($key % 2 );++$key;if($key != 1): ?><span>|</span><?php endif; ?>
        <a href="<?php echo $val['url']; ?>" class="<?php echo $val['class']; ?>"><em><?php echo $val['name']; ?></em></a>
        <?php endforeach; endif; else: echo "" ;endif; endif; endif; ?>
    </div>
</div>

<!--图片水印设置-->
<div class="pad_lr_10 mt10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
			<li class="current">微信设置</li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<form id="info_form" action="<?php echo url('Setting/editDo'); ?>" method="post" enctype="multipart/form-data">
					<table width="100%" class="table_form">
						<tr>
							<th width="150">公众号类型 :</th>
							<td>
								<label class="mr10"><input name="data[weixin_type]" type="radio" value="1" class="J_change_status" <?php if($info['weixin_type'] == 1): ?>checked<?php endif; ?>>认证订阅号 </label>
								<label><input name="data[weixin_type]" type="radio" value="2" class="J_change_status" <?php if($info['weixin_type'] == 2): ?>checked<?php endif; ?>>认证服务号</label>
							</td>
						</tr>
						<tr>
							<th width="150">appid :</th>
							<td>
								<input type="text" name="data[weixin_appid]" value="<?php echo $info['weixin_appid']; ?>" class="input-text" size="30">
							</td>
						</tr>
						<tr>
							<th>appsecret :</th>
							<td><input type="text" name="data[weixin_appsecret]" class="input-text" value="<?php echo $info['weixin_appsecret']; ?>"  size="30" /></td>
						</tr>
						<tr>
							<th>token :</th>
							<td>
								<input type="text" name="data[weixin_token]" class="input-text" value="<?php if(isset($info['weixin_token'])): ?><?php echo $info['weixin_token']; endif; ?>" size="30">
							</td>
						</tr>
						<tr>
							<th>encodingaeskey :</th>
							<td>
								<input type="text" name="data[weixin_appkey]"  value="<?php echo $info['weixin_appkey']; ?>" class="input-text" size="30"/>
							</td>
						</tr>
						<tr>
							<th>Oauth 2.0</th>
							<td>在微信公众号请求用户网页授权之前，开发者需要先到公众平台网站的【开发者中心】网页服务中配置授权回调域名。回调域名请设置为：<span style="color:#ff0000;"><?php echo config('url_domain_root'); ?></span></td>
						</tr>
						<tr>
							<th>接口地址 :</th>
							<td>
								<?php if(empty($auth_url) || (($auth_url instanceof \think\Collection || $auth_url instanceof \think\Paginator ) && $auth_url->isEmpty())): ?><a href="<?php echo url('Setting/index',['type'=>'site']); ?>">请先设置站点域名</a><?php else: ?><?php echo $auth_url; endif; ?>
							</td>
						</tr>
						<tr>
							<th>接收消息的微信号 :</th>
							<td>
								<input type="text" name="data[weixin]" class="input-text" size="30" value="<?php if(isset($info['weixin'])): ?><?php echo $info['weixin']; endif; ?>"><span><span style="color:#ff0000;">必须是已关注此公众账号的微信号</span>用户预约、团购报名、领取红包信息将会推送到此微信号</span>
							</td>
						</tr>
						<tr>
							<th>公众号认证文件 :</th>
							<td>
								<input type="text" name="" id="J_file" value=""  class="input-text fl mr10" size="50">
								<div id="J_weixin_upload_file" class="btn" onclick="ajaxUploadFile('J_weixin_upload_file','J_file');"><span>上传</span></div>
								<p style="float:none;clear:both;">公众号设置网页授权回调域名时，提示需要上传认证文件。请下载下来，并在此处上传。</p>
							</td>
						</tr>
						<tr>
							<th></th>
							<td>
								<input type="hidden" name="name" value="<?php echo $action_name; ?>">
								<input type="hidden" name="id" value="<?php echo $base['id']; ?>">
								<input type="submit" class="btn btn_submit" value="提交"/>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								1、登录微信公众平台:左侧菜单->开发->基本配置：填入对应的appid,appsecrect 修改服务器配置 填写服务器接口url地址(<?php if(empty($auth_url) || (($auth_url instanceof \think\Collection || $auth_url instanceof \think\Paginator ) && $auth_url->isEmpty())): ?><a href="<?php echo url('Setting/index',['type'=>'site']); ?>">请先设置站点域名</a><?php else: ?><?php echo $auth_url; endif; ?>)<br />
									填写Token,EncodingAESKey(这两者必需要填写正确，可在公众平台随机生成保存后再填写到网站配置中)，保存公众平台配置后，点击启用按钮，接口配置才会生效。
								<p>
									2、登录微信公众平台:左侧菜单->设置->公众号设置->功能设置->网页授权域名：填写域名(<?php echo config('url_domain_root'); ?>)，下载验证文件在本站上传。
								</p>
								<p>
									<img src="__IMG__/wx_setting.jpg" alt=""><br />
									<img src="__IMG__/wx_auth.jpg" alt="">
								</p>
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</div>
<script src="__PUBLIC__/js/jquery.min.1.7.2.js"></script>
<script src="__JS__/manage.js"></script>
<script src="__JS__/admin.js"></script>
<script>
//初始化弹窗
(function (d) {
    d['okValue'] = '确定';
    d['cancelValue'] = '取消';
    d['title'] = '标题';
})($.dialog.defaults);
</script>
<script src="__PUBLIC__/js/plugins/formvalidator.js"></script>
<?php if(isset($list_table)): ?>
<script src="__PUBLIC__/js/plugins/listTable.js"></script>
<script>
$(function(){
	$('.J_tablelist').listTable();
});
</script>
<?php endif; ?>
<script src="__PUBLIC__/js/plugins/fileuploader.js"></script>
<script type="text/javascript">
	function ajaxUploadFile(btn,input){
		//上传文件

		var img_uploader = new qq.FileUploaderBasic({
			allowedExtensions: ['txt'],
			button: document.getElementById(btn),
			multiple: false,
			action: "<?php echo url('Setting/ajaxUploadFile'); ?>",
			inputName: 'file',
			forceMultipart: true, //用$_FILES
			messages: {
				typeError: "{file} 文件类型不符合: {extensions}.",
				sizeError: "{file} 太大了, 最大不超过 {sizeLimit}.",
				minSizeError: "{file} is too small, minimum file size is {minSizeLimit}.",
				emptyError: "{file} is empty, please select files again without it.",
				noFilesError: "No files to upload.",
				onLeave: "The files are being uploaded, if you leave now the upload will be cancelled."
			},
			showMessage: function(message){
				layer.msg(message,{icon:2});
			},
			onSubmit: function(id, fileName){
				$('#'+btn).addClass('btn_disabled').find('span').text('上传中，请稍候...');
			},
			onComplete: function(id, fileName, result){
				$('#'+btn).removeClass('btn_disabled').find('span').text('上传');
				if(result.status == '1'){
					$('#'+input).val(result.data);
				} else {
					layer.msg(result.msg,{icon:2});
				}
			}
		});
	}
</script>
</body>
</html>